home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / gcc / gcc261a.zoo / info / libg++.info-1 < prev    next >
Encoding:
GNU Info File  |  1994-11-07  |  40.1 KB  |  823 lines

  1. This is Info file libg++.info, produced by Makeinfo-1.55 from the input
  2. file ./libg++.texi.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * Libg++: (libg++).             The g++ class library.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents the features and implementation of The GNU C++
  9. library
  10.  
  11.    Copyright (C) 1988, 1991, 1992 Free Software Foundation, Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided also
  19. that the section entitled "GNU Library General Public License" is
  20. included exactly as in the original, and provided that the entire
  21. resulting derived work is distributed under the terms of a permission
  22. notice identical to this one.
  23.  
  24.    Permission is granted to copy and distribute translations of this
  25. manual into another language, under the above conditions for modified
  26. versions, except that the section entitled "GNU Library General Public
  27. License" and this permission notice may be included in translations
  28. approved by the Free Software Foundation instead of in the original
  29. English.
  30.  
  31. File: libg++.info,  Node: Top,  Next: Copying,  Up: (DIR)
  32.  
  33.    Introduction ************
  34.  
  35.    This manual documents how to install and use the GNU C++ library.
  36.  
  37. * Menu:
  38.  
  39. * Copying::        GNU Library Public License says how you can copy
  40.                     and share the GNU C++ library.
  41. * Contributors::    People who have contributed to GNU C++ library.
  42. * Installation::    How to configure, compile and install GNU C++ library
  43. * Trouble::         If you have trouble installing GNU C++ library.
  44. * General::         Aims, objectives, and limitations of the GNU C++ library
  45. * Conventions::     Stylistic conventions
  46. * OK::              Support for representation invariants
  47. * Proto::           Introduction to container class prototypes
  48. * Pix::             Pseudo-indexes
  49. * Representations:: How variable-sized objects are represented
  50. * Expressions::     Some guidance on programming expression-oriented classes
  51. * Headers::         Header files and other support for interfacing C++ to C
  52. * Builtin::         Utility functions for builtin types
  53. * New::             Library dynamic allocation primitives
  54. * IOStream:(iostream)Top.
  55.                     The input/output library (istreams and ostreams).
  56. * Stream::          obsolete I/O library
  57. * Obstack::         Obstacks and their uses.
  58. * AllocRing::       A place to store objects for a while
  59. * String::          String, SubString, and Regex classes.
  60. * Integer::         Multiple precision Integer class.
  61. * Rational::        Multiple precision Rational class
  62. * Complex::         Complex number class
  63. * Fix::             Fixed point proportion classes
  64. * Bit::             BitSet and BitString classes
  65. * Random::          Random number generators
  66. * Data::            SampleStatistic and related classes for data collection
  67. * Curses::          CursesWindow class
  68. * List::            Lisp-like List prototype
  69. * LinkList::        Singly and doubly linked list class prototypes
  70. * Vector::          Vector prototypes
  71. * Plex::            Plex (adjustable array) prototypes
  72. * Stack::           Stack prototypes
  73. * Queue::           Queue prototypes
  74. * Deque::           Double ended queue prototypes
  75. * PQ::              Heap (priority queue) class prototypes
  76. * Set::             Set class prototypes
  77. * Bag::             Bag class prototypes
  78. * Map::             Map (Associative array) prototypes
  79. * GetOpt::          C++ class-based version of the GNU/UNIX getopt function
  80. * Projects::        Things Still Left to do
  81.  
  82. File: libg++.info,  Node: Copying,  Next: Contributors,  Prev: Top,  Up: Top
  83.  
  84. GNU LIBRARY GENERAL PUBLIC LICENSE
  85. **********************************
  86.  
  87.                          Version 2, June 1991
  88.  
  89.      Copyright (C) 1991 Free Software Foundation, Inc.
  90.      675 Mass Ave, Cambridge, MA 02139, USA
  91.      Everyone is permitted to copy and distribute verbatim copies
  92.      of this license document, but changing it is not allowed.
  93.      
  94.      [This is the first released version of the library GPL.  It is
  95.       numbered 2 because it goes with version 2 of the ordinary GPL.]
  96.  
  97. Preamble
  98. ========
  99.  
  100.    The licenses for most software are designed to take away your
  101. freedom to share and change it.  By contrast, the GNU General Public
  102. Licenses are intended to guarantee your freedom to share and change
  103. free software--to make sure the software is free for all its users.
  104.  
  105.    This license, the Library General Public License, applies to some
  106. specially designated Free Software Foundation software, and to any
  107. other libraries whose authors decide to use it.  You can use it for
  108. your libraries, too.
  109.  
  110.    When we speak of free software, we are referring to freedom, not
  111. price.  Our General Public Licenses are designed to make sure that you
  112. have the freedom to distribute copies of free software (and charge for
  113. this service if you wish), that you receive source code or can get it
  114. if you want it, that you can change the software or use pieces of it in
  115. new free programs; and that you know you can do these things.
  116.  
  117.    To protect your rights, we need to make restrictions that forbid
  118. anyone to deny you these rights or to ask you to surrender the rights.
  119. These restrictions translate to certain responsibilities for you if you
  120. distribute copies of the library, or if you modify it.
  121.  
  122.    For example, if you distribute copies of the library, whether gratis
  123. or for a fee, you must give the recipients all the rights that we gave
  124. you.  You must make sure that they, too, receive or can get the source
  125. code.  If you link a program with the library, you must provide
  126. complete object files to the recipients so that they can relink them
  127. with the library, after making changes to the library and recompiling
  128. it.  And you must show them these terms so they know their rights.
  129.  
  130.    Our method of protecting your rights has two steps: (1) copyright
  131. the library, and (2) offer you this license which gives you legal
  132. permission to copy, distribute and/or modify the library.
  133.  
  134.    Also, for each distributor's protection, we want to make certain
  135. that everyone understands that there is no warranty for this free
  136. library.  If the library is modified by someone else and passed on, we
  137. want its recipients to know that what they have is not the original
  138. version, so that any problems introduced by others will not reflect on
  139. the original authors' reputations.
  140.  
  141.    Finally, any free program is threatened constantly by software
  142. patents.  We wish to avoid the danger that companies distributing free
  143. software will individually obtain patent licenses, thus in effect
  144. transforming the program into proprietary software.  To prevent this,
  145. we have made it clear that any patent must be licensed for everyone's
  146. free use or not licensed at all.
  147.  
  148.    Most GNU software, including some libraries, is covered by the
  149. ordinary GNU General Public License, which was designed for utility
  150. programs.  This license, the GNU Library General Public License,
  151. applies to certain designated libraries.  This license is quite
  152. different from the ordinary one; be sure to read it in full, and don't
  153. assume that anything in it is the same as in the ordinary license.
  154.  
  155.    The reason we have a separate public license for some libraries is
  156. that they blur the distinction we usually make between modifying or
  157. adding to a program and simply using it.  Linking a program with a
  158. library, without changing the library, is in some sense simply using
  159. the library, and is analogous to running a utility program or
  160. application program.  However, in a textual and legal sense, the linked
  161. executable is a combined work, a derivative of the original library,
  162. and the ordinary General Public License treats it as such.
  163.  
  164.    Because of this blurred distinction, using the ordinary General
  165. Public License for libraries did not effectively promote software
  166. sharing, because most developers did not use the libraries.  We
  167. concluded that weaker conditions might promote sharing better.
  168.  
  169.    However, unrestricted linking of non-free programs would deprive the
  170. users of those programs of all benefit from the free status of the
  171. libraries themselves.  This Library General Public License is intended
  172. to permit developers of non-free programs to use free libraries, while
  173. preserving your freedom as a user of such programs to change the free
  174. libraries that are incorporated in them.  (We have not seen how to
  175. achieve this as regards changes in header files, but we have achieved
  176. it as regards changes in the actual functions of the Library.)  The
  177. hope is that this will lead to faster development of free libraries.
  178.  
  179.    The precise terms and conditions for copying, distribution and
  180. modification follow.  Pay close attention to the difference between a
  181. "work based on the library" and a "work that uses the library".  The
  182. former contains code derived from the library, while the latter only
  183. works together with the library.
  184.  
  185.    Note that it is possible for a library to be covered by the ordinary
  186. General Public License rather than by this special one.
  187.  
  188.     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  189.  
  190.   0. This License Agreement applies to any software library which
  191.      contains a notice placed by the copyright holder or other
  192.      authorized party saying it may be distributed under the terms of
  193.      this Library General Public License (also called "this License").
  194.      Each licensee is addressed as "you".
  195.  
  196.      A "library" means a collection of software functions and/or data
  197.      prepared so as to be conveniently linked with application programs
  198.      (which use some of those functions and data) to form executables.
  199.  
  200.      The "Library", below, refers to any such software library or work
  201.      which has been distributed under these terms.  A "work based on the
  202.      Library" means either the Library or any derivative work under
  203.      copyright law: that is to say, a work containing the Library or a
  204.      portion of it, either verbatim or with modifications and/or
  205.      translated straightforwardly into another language.  (Hereinafter,
  206.      translation is included without limitation in the term
  207.      "modification".)
  208.  
  209.      "Source code" for a work means the preferred form of the work for
  210.      making modifications to it.  For a library, complete source code
  211.      means all the source code for all modules it contains, plus any
  212.      associated interface definition files, plus the scripts used to
  213.      control compilation and installation of the library.
  214.  
  215.      Activities other than copying, distribution and modification are
  216.      not covered by this License; they are outside its scope.  The act
  217.      of running a program using the Library is not restricted, and
  218.      output from such a program is covered only if its contents
  219.      constitute a work based on the Library (independent of the use of
  220.      the Library in a tool for writing it).  Whether that is true
  221.      depends on what the Library does and what the program that uses
  222.      the Library does.
  223.  
  224.   1. You may copy and distribute verbatim copies of the Library's
  225.      complete source code as you receive it, in any medium, provided
  226.      that you conspicuously and appropriately publish on each copy an
  227.      appropriate copyright notice and disclaimer of warranty; keep
  228.      intact all the notices that refer to this License and to the
  229.      absence of any warranty; and distribute a copy of this License
  230.      along with the Library.
  231.  
  232.      You may charge a fee for the physical act of transferring a copy,
  233.      and you may at your option offer warranty protection in exchange
  234.      for a fee.
  235.  
  236.   2. You may modify your copy or copies of the Library or any portion
  237.      of it, thus forming a work based on the Library, and copy and
  238.      distribute such modifications or work under the terms of Section 1
  239.      above, provided that you also meet all of these conditions:
  240.  
  241.        a. The modified work must itself be a software library.
  242.  
  243.        b. You must cause the files modified to carry prominent notices
  244.           stating that you changed the files and the date of any change.
  245.  
  246.        c. You must cause the whole of the work to be licensed at no
  247.           charge to all third parties under the terms of this License.
  248.  
  249.        d. If a facility in the modified Library refers to a function or
  250.           a table of data to be supplied by an application program that
  251.           uses the facility, other than as an argument passed when the
  252.           facility is invoked, then you must make a good faith effort
  253.           to ensure that, in the event an application does not supply
  254.           such function or table, the facility still operates, and
  255.           performs whatever part of its purpose remains meaningful.
  256.  
  257.           (For example, a function in a library to compute square roots
  258.           has a purpose that is entirely well-defined independent of the
  259.           application.  Therefore, Subsection 2d requires that any
  260.           application-supplied function or table used by this function
  261.           must be optional: if the application does not supply it, the
  262.           square root function must still compute square roots.)
  263.  
  264.      These requirements apply to the modified work as a whole.  If
  265.      identifiable sections of that work are not derived from the
  266.      Library, and can be reasonably considered independent and separate
  267.      works in themselves, then this License, and its terms, do not
  268.      apply to those sections when you distribute them as separate
  269.      works.  But when you distribute the same sections as part of a
  270.      whole which is a work based on the Library, the distribution of
  271.      the whole must be on the terms of this License, whose permissions
  272.      for other licensees extend to the entire whole, and thus to each
  273.      and every part regardless of who wrote it.
  274.  
  275.      Thus, it is not the intent of this section to claim rights or
  276.      contest your rights to work written entirely by you; rather, the
  277.      intent is to exercise the right to control the distribution of
  278.      derivative or collective works based on the Library.
  279.  
  280.      In addition, mere aggregation of another work not based on the
  281.      Library with the Library (or with a work based on the Library) on
  282.      a volume of a storage or distribution medium does not bring the
  283.      other work under the scope of this License.
  284.  
  285.   3. You may opt to apply the terms of the ordinary GNU General Public
  286.      License instead of this License to a given copy of the Library.
  287.      To do this, you must alter all the notices that refer to this
  288.      License, so that they refer to the ordinary GNU General Public
  289.      License, version 2, instead of to this License.  (If a newer
  290.      version than version 2 of the ordinary GNU General Public License
  291.      has appeared, then you can specify that version instead if you
  292.      wish.)  Do not make any other change in these notices.
  293.  
  294.      Once this change is made in a given copy, it is irreversible for
  295.      that copy, so the ordinary GNU General Public License applies to
  296.      all subsequent copies and derivative works made from that copy.
  297.  
  298.      This option is useful when you wish to copy part of the code of
  299.      the Library into a program that is not a library.
  300.  
  301.   4. You may copy and distribute the Library (or a portion or
  302.      derivative of it, under Section 2) in object code or executable
  303.      form under the terms of Sections 1 and 2 above provided that you
  304.      accompany it with the complete corresponding machine-readable
  305.      source code, which must be distributed under the terms of Sections
  306.      1 and 2 above on a medium customarily used for software
  307.      interchange.
  308.  
  309.      If distribution of object code is made by offering access to copy
  310.      from a designated place, then offering equivalent access to copy
  311.      the source code from the same place satisfies the requirement to
  312.      distribute the source code, even though third parties are not
  313.      compelled to copy the source along with the object code.
  314.  
  315.   5. A program that contains no derivative of any portion of the
  316.      Library, but is designed to work with the Library by being
  317.      compiled or linked with it, is called a "work that uses the
  318.      Library".  Such a work, in isolation, is not a derivative work of
  319.      the Library, and therefore falls outside the scope of this License.
  320.  
  321.      However, linking a "work that uses the Library" with the Library
  322.      creates an executable that is a derivative of the Library (because
  323.      it contains portions of the Library), rather than a "work that
  324.      uses the library".  The executable is therefore covered by this
  325.      License.  Section 6 states terms for distribution of such
  326.      executables.
  327.  
  328.      When a "work that uses the Library" uses material from a header
  329.      file that is part of the Library, the object code for the work may
  330.      be a derivative work of the Library even though the source code is
  331.      not.  Whether this is true is especially significant if the work
  332.      can be linked without the Library, or if the work is itself a
  333.      library.  The threshold for this to be true is not precisely
  334.      defined by law.
  335.  
  336.      If such an object file uses only numerical parameters, data
  337.      structure layouts and accessors, and small macros and small inline
  338.      functions (ten lines or less in length), then the use of the object
  339.      file is unrestricted, regardless of whether it is legally a
  340.      derivative work.  (Executables containing this object code plus
  341.      portions of the Library will still fall under Section 6.)
  342.  
  343.      Otherwise, if the work is a derivative of the Library, you may
  344.      distribute the object code for the work under the terms of Section
  345.      6.  Any executables containing that work also fall under Section 6,
  346.      whether or not they are linked directly with the Library itself.
  347.  
  348.   6. As an exception to the Sections above, you may also compile or
  349.      link a "work that uses the Library" with the Library to produce a
  350.      work containing portions of the Library, and distribute that work
  351.      under terms of your choice, provided that the terms permit
  352.      modification of the work for the customer's own use and reverse
  353.      engineering for debugging such modifications.
  354.  
  355.      You must give prominent notice with each copy of the work that the
  356.      Library is used in it and that the Library and its use are covered
  357.      by this License.  You must supply a copy of this License.  If the
  358.      work during execution displays copyright notices, you must include
  359.      the copyright notice for the Library among them, as well as a
  360.      reference directing the user to the copy of this License.  Also,
  361.      you must do one of these things:
  362.  
  363.        a. Accompany the work with the complete corresponding
  364.           machine-readable source code for the Library including
  365.           whatever changes were used in the work (which must be
  366.           distributed under Sections 1 and 2 above); and, if the work
  367.           is an executable linked with the Library, with the complete
  368.           machine-readable "work that uses the Library", as object code
  369.           and/or source code, so that the user can modify the Library
  370.           and then relink to produce a modified executable containing
  371.           the modified Library.  (It is understood that the user who
  372.           changes the contents of definitions files in the Library will
  373.           not necessarily be able to recompile the application to use
  374.           the modified definitions.)
  375.  
  376.        b. Accompany the work with a written offer, valid for at least
  377.           three years, to give the same user the materials specified in
  378.           Subsection 6a, above, for a charge no more than the cost of
  379.           performing this distribution.
  380.  
  381.        c. If distribution of the work is made by offering access to copy
  382.           from a designated place, offer equivalent access to copy the
  383.           above specified materials from the same place.
  384.  
  385.        d. Verify that the user has already received a copy of these
  386.           materials or that you have already sent this user a copy.
  387.  
  388.      For an executable, the required form of the "work that uses the
  389.      Library" must include any data and utility programs needed for
  390.      reproducing the executable from it.  However, as a special
  391.      exception, the source code distributed need not include anything
  392.      that is normally distributed (in either source or binary form)
  393.      with the major components (compiler, kernel, and so on) of the
  394.      operating system on which the executable runs, unless that
  395.      component itself accompanies the executable.
  396.  
  397.      It may happen that this requirement contradicts the license
  398.      restrictions of other proprietary libraries that do not normally
  399.      accompany the operating system.  Such a contradiction means you
  400.      cannot use both them and the Library together in an executable
  401.      that you distribute.
  402.  
  403.   7. You may place library facilities that are a work based on the
  404.      Library side-by-side in a single library together with other
  405.      library facilities not covered by this License, and distribute
  406.      such a combined library, provided that the separate distribution
  407.      of the work based on the Library and of the other library
  408.      facilities is otherwise permitted, and provided that you do these
  409.      two things:
  410.  
  411.        a. Accompany the combined library with a copy of the same work
  412.           based on the Library, uncombined with any other library
  413.           facilities.  This must be distributed under the terms of the
  414.           Sections above.
  415.  
  416.        b. Give prominent notice with the combined library of the fact
  417.           that part of it is a work based on the Library, and explaining
  418.           where to find the accompanying uncombined form of the same
  419.           work.
  420.  
  421.   8. You may not copy, modify, sublicense, link with, or distribute the
  422.      Library except as expressly provided under this License.  Any
  423.      attempt otherwise to copy, modify, sublicense, link with, or
  424.      distribute the Library is void, and will automatically terminate
  425.      your rights under this License.  However, parties who have
  426.      received copies, or rights, from you under this License will not
  427.      have their licenses terminated so long as such parties remain in
  428.      full compliance.
  429.  
  430.   9. You are not required to accept this License, since you have not
  431.      signed it.  However, nothing else grants you permission to modify
  432.      or distribute the Library or its derivative works.  These actions
  433.      are prohibited by law if you do not accept this License.
  434.      Therefore, by modifying or distributing the Library (or any work
  435.      based on the Library), you indicate your acceptance of this
  436.      License to do so, and all its terms and conditions for copying,
  437.      distributing or modifying the Library or works based on it.
  438.  
  439.  10. Each time you redistribute the Library (or any work based on the
  440.      Library), the recipient automatically receives a license from the
  441.      original licensor to copy, distribute, link with or modify the
  442.      Library subject to these terms and conditions.  You may not impose
  443.      any further restrictions on the recipients' exercise of the rights
  444.      granted herein.  You are not responsible for enforcing compliance
  445.      by third parties to this License.
  446.  
  447.  11. If, as a consequence of a court judgment or allegation of patent
  448.      infringement or for any other reason (not limited to patent
  449.      issues), conditions are imposed on you (whether by court order,
  450.      agreement or otherwise) that contradict the conditions of this
  451.      License, they do not excuse you from the conditions of this
  452.      License.  If you cannot distribute so as to satisfy simultaneously
  453.      your obligations under this License and any other pertinent
  454.      obligations, then as a consequence you may not distribute the
  455.      Library at all.  For example, if a patent license would not permit
  456.      royalty-free redistribution of the Library by all those who
  457.      receive copies directly or indirectly through you, then the only
  458.      way you could satisfy both it and this License would be to refrain
  459.      entirely from distribution of the Library.
  460.  
  461.      If any portion of this section is held invalid or unenforceable
  462.      under any particular circumstance, the balance of the section is
  463.      intended to apply, and the section as a whole is intended to apply
  464.      in other circumstances.
  465.  
  466.      It is not the purpose of this section to induce you to infringe any
  467.      patents or other property right claims or to contest validity of
  468.      any such claims; this section has the sole purpose of protecting
  469.      the integrity of the free software distribution system which is
  470.      implemented by public license practices.  Many people have made
  471.      generous contributions to the wide range of software distributed
  472.      through that system in reliance on consistent application of that
  473.      system; it is up to the author/donor to decide if he or she is
  474.      willing to distribute software through any other system and a
  475.      licensee cannot impose that choice.
  476.  
  477.      This section is intended to make thoroughly clear what is believed
  478.      to be a consequence of the rest of this License.
  479.  
  480.  12. If the distribution and/or use of the Library is restricted in
  481.      certain countries either by patents or by copyrighted interfaces,
  482.      the original copyright holder who places the Library under this
  483.      License may add an explicit geographical distribution limitation
  484.      excluding those countries, so that distribution is permitted only
  485.      in or among countries not thus excluded.  In such case, this
  486.      License incorporates the limitation as if written in the body of
  487.      this License.
  488.  
  489.  13. The Free Software Foundation may publish revised and/or new
  490.      versions of the Library General Public License from time to time.
  491.      Such new versions will be similar in spirit to the present version,
  492.      but may differ in detail to address new problems or concerns.
  493.  
  494.      Each version is given a distinguishing version number.  If the
  495.      Library specifies a version number of this License which applies
  496.      to it and "any later version", you have the option of following
  497.      the terms and conditions either of that version or of any later
  498.      version published by the Free Software Foundation.  If the Library
  499.      does not specify a license version number, you may choose any
  500.      version ever published by the Free Software Foundation.
  501.  
  502.  14. If you wish to incorporate parts of the Library into other free
  503.      programs whose distribution conditions are incompatible with these,
  504.      write to the author to ask for permission.  For software which is
  505.      copyrighted by the Free Software Foundation, write to the Free
  506.      Software Foundation; we sometimes make exceptions for this.  Our
  507.      decision will be guided by the two goals of preserving the free
  508.      status of all derivatives of our free software and of promoting
  509.      the sharing and reuse of software generally.
  510.  
  511.                                 NO WARRANTY
  512.  
  513.  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
  514.      WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE
  515.      LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
  516.      HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT
  517.      WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
  518.      NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  519.      FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE
  520.      QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU.  SHOULD THE
  521.      LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  522.      SERVICING, REPAIR OR CORRECTION.
  523.  
  524.  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
  525.      WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
  526.      MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE
  527.      LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
  528.      INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
  529.      INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF
  530.      DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
  531.      OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY
  532.      OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
  533.      ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  534.  
  535.                       END OF TERMS AND CONDITIONS
  536.  
  537. How to Apply These Terms to Your New Libraries
  538. ==============================================
  539.  
  540.    If you develop a new library, and you want it to be of the greatest
  541. possible use to the public, we recommend making it free software that
  542. everyone can redistribute and change.  You can do so by permitting
  543. redistribution under these terms (or, alternatively, under the terms of
  544. the ordinary General Public License).
  545.  
  546.    To apply these terms, attach the following notices to the library.
  547. It is safest to attach them to the start of each source file to most
  548. effectively convey the exclusion of warranty; and each file should have
  549. at least the "copyright" line and a pointer to where the full notice is
  550. found.
  551.  
  552.      ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES.
  553.      Copyright (C) YEAR  NAME OF AUTHOR
  554.      
  555.      This library is free software; you can redistribute it and/or
  556.      modify it under the terms of the GNU Library General Public
  557.      License as published by the Free Software Foundation; either
  558.      version 2 of the License, or (at your option) any later version.
  559.      
  560.      This library is distributed in the hope that it will be useful,
  561.      but WITHOUT ANY WARRANTY; without even the implied warranty of
  562.      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  563.      Library General Public License for more details.
  564.      
  565.      You should have received a copy of the GNU Library General Public
  566.      License along with this library; if not, write to the
  567.      Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
  568.      MA 02139, USA.
  569.  
  570.    Also add information on how to contact you by electronic and paper
  571. mail.
  572.  
  573.    You should also get your employer (if you work as a programmer) or
  574. your school, if any, to sign a "copyright disclaimer" for the library,
  575. if necessary.  Here is a sample; alter the names:
  576.  
  577.      Yoyodyne, Inc., hereby disclaims all copyright interest in
  578.      the library `Frob' (a library for tweaking knobs) written
  579.      by James Random Hacker.
  580.      
  581.      SIGNATURE OF TY COON, 1 April 1990
  582.      Ty Coon, President of Vice
  583.  
  584.    That's all there is to it!
  585.  
  586. File: libg++.info,  Node: Contributors,  Next: Installation,  Prev: Copying,  Up: Top
  587.  
  588. Contributors to GNU C++ library
  589. *******************************
  590.  
  591.    Aside from Michael Tiemann, who worked out the front end for GNU
  592. C++, and Richard Stallman, who worked out the back end, the following
  593. people (not including those who have made their contributions to GNU
  594. CC) should not go unmentioned.
  595.  
  596.    * Doug Lea contributed most otherwise unattributed classes.
  597.  
  598.    * Per Bothner contributed the iostream I/O classes.
  599.  
  600.    * Dirk Grunwald contributed the Random number generation classes,
  601.      and PairingHeaps.
  602.  
  603.    * Kurt Baudendistel contributed Fixed precision reals.
  604.  
  605.    * Doug Schmidt contributed ordered hash tables, a perfect hash
  606.      function generator, and several other utilities.
  607.  
  608.    * Marc Shapiro contributed the ideas and preliminary code for Plexes.
  609.  
  610.    * Eric Newton contributed the curses window classes.
  611.  
  612.    * Some of the I/O code is derived from BSD 4.4, and was developed by
  613.      the University of California, Berkeley.
  614.  
  615.    * The code for converting accurately between floating point numbers
  616.      and their string representations was written by David M. Gay of
  617.      AT&T.
  618.  
  619. File: libg++.info,  Node: Installation,  Next: Trouble,  Prev: Contributors,  Up: Top
  620.  
  621. Installing GNU C++ library
  622. **************************
  623.  
  624.   1. Read through the README file and the Makefile. Make sure that all
  625.      paths, system-dependent compile switches, and program names are
  626.      correct.
  627.  
  628.   2. Check that files  `values.h', `stdio.h', and `math.h' declare and
  629.      define values appropriate for your system.
  630.  
  631.   3. Type `make all' to compile the library, test, and install.
  632.      Current details about contents of the tests and utilities are in
  633.      the `README' file.
  634.  
  635.  
  636. File: libg++.info,  Node: Trouble,  Next: General,  Prev: Installation,  Up: Top
  637.  
  638. Trouble in Installation
  639. ***********************
  640.  
  641.    Here are some of the things that have caused trouble for people
  642. installing GNU C++ library.
  643.  
  644.   1. Make sure that your GNU C++ version number is at least as high as
  645.      your libg++ version number. For example, libg++ 1.22.0 requires
  646.      g++ 1.22.0 or later releases.
  647.  
  648.   2. Double-check system constants in the header files mentioned above.
  649.  
  650.  
  651. File: libg++.info,  Node: General,  Next: Conventions,  Prev: Trouble,  Up: Top
  652.  
  653. GNU C++ library aims, objectives, and limitations
  654. *************************************************
  655.  
  656.    The GNU C++ library, libg++ is an attempt to provide a variety of C++
  657. programming tools and other support to GNU C++ programmers.
  658.  
  659.    Differences in distribution policy are only part of the difference
  660. between libg++.a and AT&T libC.a.  libg++ is not intended to be an
  661. exact clone of libC. For one, libg++ contains bits of code that depend
  662. on special features of GNU g++ that are either different or lacking in
  663. the AT&T version, including slightly different inlining and overloading
  664. strategies, dynamic local arrays, etc.  All of these differences are
  665. minor. For example, while the AT&T and GNU stream classes are
  666. implemented in very different ways, the vast majority of C++ programs
  667. compile and run under either version with no visible difference.
  668. Additionally, all g++-specific constructs are conditionally compiled;
  669. The library is designed to be compatible with any 2.0 C++ compiler.
  670.  
  671.    libg++ has also contained workarounds for some limitations in g++:
  672. both g++ and libg++ are still undergoing rapid development and
  673. testing--a task that is helped tremendously by the feedback of active
  674. users.  This manual is also still under development; it has some
  675. catching up to do to include all the facilities now in the library.
  676.  
  677.    libg++ is not the only freely available source of C++ class
  678. libraries.  Some notable alternative sources are Interviews and NIHCL.
  679. (InterViews has been available on the X-windows X11 tapes and also from
  680. interviews.stanford.edu.  NIHCL is available by anonymous ftp from GNU
  681. archives (such as the pub directory of prep.ai.mit.edu), although it is
  682. not supported by the FSF - and needs some work before it will work with
  683. g++.)
  684.  
  685.    As every C++ programmer knows, the design (moreso than the
  686. implementation) of a C++ class library is something of a challenge.
  687. Part of the reason is that C++ supports two, partially incompatible,
  688. styles of object-oriented programming - The "forest" approach,
  689. involving a collection of free-standing classes that can be mixed and
  690. matched, versus the completely hierarchical (smalltalk style) approach,
  691. in which all classes are derived from a common ancestor.  Of course,
  692. both styles have advantages and disadvantages.  So far, libg++ has
  693. adopted the "forest" approach.  Keith Gorlen's OOPS library adopts the
  694. hierarchical approach, and may be an attractive alternative for C++
  695. programmers who prefer this style.
  696.  
  697.    Currently (and/or in the near future) libg++ provides support for a
  698. few basic kinds of classes:
  699.  
  700.    The first kind of support provides an interface between C++ programs
  701. and C libraries. This includes basic header files (like `stdio.h') as
  702. well as things like the File and stream classes. Other classes that
  703. interface to other aspects of C libraries (like those that maintain
  704. environmental information) are in various stages of development; all
  705. will undergo implementation modifications when the forthcoming GNU libc
  706. library is released.
  707.  
  708.    The second kind of support contains general-purpose basic classes
  709. that transparently manage variable-sized objects on the freestore.  This
  710. includes Obstacks, multiple-precision Integers and Rationals, arbitrary
  711. length Strings, BitSets, and BitStrings.
  712.  
  713.    Third, several classes and utilities of common interest (e.g.,
  714. Complex numbers) are provided.
  715.  
  716.    Fourth, a set of pseudo-generic prototype files are available as a
  717. mechanism for generating common container classes. These are described
  718. in more detail in the introduction to container prototypes. Currently,
  719. only a textual substitution mechanism is available for generic class
  720. creation.
  721.  
  722. File: libg++.info,  Node: Conventions,  Next: OK,  Prev: General,  Up: Top
  723.  
  724. GNU C++ library stylistic conventions
  725. *************************************
  726.  
  727.    * C++ source files have file extension `.cc'. Both C-compatibility
  728.      header files and class declaration files have extension `.h'.
  729.  
  730.    * C++ class names begin with capital letters, except for `istream'
  731.      and `ostream', for AT&T C++ compatibility. Multi-word class names
  732.      capitalize each word, with no underscore separation.
  733.  
  734.    * Include files that define C++ classes begin with capital letters
  735.      (as do the names of the classes themselves).  `stream.h' is
  736.      uncapitalized for AT&T C++ compatibility.
  737.  
  738.    * Include files that supply function prototypes for other C
  739.      functions (system calls and libraries) are all lower case.
  740.  
  741.    * All include files define a preprocessor variable _X_h, where X is
  742.      the name of the file, and conditionally compile only if this has
  743.      not been already defined. The `#pragma once' facility is also used
  744.      to avoid re-inclusion.
  745.  
  746.    * Structures and objects that must be publicly defined, but are not
  747.      intended for public use have names beginning with an underscore.
  748.      (for example, the `_Srep' struct, which is used only by the String
  749.      and SubString classes.)
  750.  
  751.    * The underscore is used to separate components of long function
  752.      names,
  753.      e.g., `set_File_exception_handler()'.
  754.  
  755.    * When a function could be usefully defined either as a member or a
  756.      friend, it is generally a member if it modifies and/or returns
  757.      itself, else it is a friend. There are cases where naturalness of
  758.      expression wins out over this rule.
  759.  
  760.    * Class declaration files are formatted so that it is easy to
  761.      quickly check them to determine function names, parameters, and so
  762.      on. Because of the different kinds of things that may appear in
  763.      class declarations, there is no perfect way to do this. Any
  764.      suggestions on developing a common class declaration formatting
  765.      style are welcome.
  766.  
  767.    * All classes use the same simple error (exception) handling
  768.      strategy.  Almost every class has a member function named
  769.      `error(char* msg)' that invokes an associated error handler
  770.      function via a pointer to that function, so that the error
  771.      handling function may be reset by programmers. By default nearly
  772.      all call `*lib_error_handler', which prints the message and then
  773.      aborts execution. This system is subject to change. In general,
  774.      errors are assumed to be non-recoverable: Library classes do not
  775.      include code that allows graceful continuation after exceptions.
  776.  
  777. File: libg++.info,  Node: OK,  Next: Proto,  Prev: Conventions,  Up: Top
  778.  
  779. Support for representation invariants
  780. *************************************
  781.  
  782.    Most GNU C++ library classes possess a method named `OK()', that is
  783. useful in helping to verify correct performance of class operations.
  784.  
  785.    The `OK()' operations checks the "representation invariant" of a
  786. class object. This is a test to check whether the object is in a valid
  787. state. In effect, it is a (sometimes partial) verification of the
  788. library's promise that (1) class operations always leave objects in
  789. valid states, and (2) the class protects itself so that client functions
  790. cannot corrupt this state.
  791.  
  792.    While no simple validation technique can assure that all operations
  793. perform correctly, calls to `OK()' can at least verify that operations
  794. do not corrupt representations. For example for `String a, b, c; ... a
  795. = b + c;', a call to `a.OK();' will guarantee that `a' is a valid
  796. `String', but does not guarantee that it contains the concatenation of
  797. `b + c'. However, given that `a' is known to be valid, it is possible
  798. to further verify its properties, for example via `a.after(b) == c &&
  799. a.before(c) == b'. In other words, `OK()' generally checks only those
  800. internal representation properties that are otherwise inaccessible to
  801. users of the class. Other class operations are often useful for further
  802. validation.
  803.  
  804.    Failed calls to `OK()' call a class's `error' method if one exists,
  805. else directly call `abort'. Failure indicates an implementation error
  806. that should be reported.
  807.  
  808.    With only rare exceptions, the internal support functions for a class
  809. never themselves call `OK()' (although many of the test files in the
  810. distribution call `OK()' extensively).
  811.  
  812.    Verification of representational invariants can sometimes be very
  813. time consuming for complicated data structures.
  814.  
  815.